
package com.scalar.chiptrack.operations;

import java.sql.Date;

import java.util.ArrayList;
import java.util.Iterator;


public final class LotQuantity {
    
    private String m_processStepName = null;
    private int m_quantity = 0;
    private ArrayList m_lotNumberQtyAndDateOut = null;
    
    public LotQuantity() {
        m_lotNumberQtyAndDateOut = new ArrayList();
    }
    
    public String getProcessStepName() {
        return m_processStepName;
    }
    public void setProcessStepName (String processStepName) {
        m_processStepName = processStepName;
    }
    
    public int getQuantity() {
        return m_quantity;
    }
    public void setQuantity (int quantity) {
        m_quantity = quantity;
    }
    
    public ArrayList getLotNumberQtyList() {
        return m_lotNumberQtyAndDateOut;
    }
    public void setLotNumberQtyList (ArrayList lotNumberQtyAndDateOut) {
        m_lotNumberQtyAndDateOut = lotNumberQtyAndDateOut;
    }
    
    public void setLotNumberQuantityAndExpectedDateOut (String lotNumber, int qty, Date expectedDateOut) {
        m_lotNumberQtyAndDateOut.add (new LotNumberQtyAndDateOut (lotNumber, qty, expectedDateOut));
    }
    public void setLotNumberQuantityAndExpectedDateOut (String lotNumber, int qty, Date expectedDateOut, String lotStatus) {
        m_lotNumberQtyAndDateOut.add (new LotNumberQtyAndDateOut (lotNumber, qty, expectedDateOut, lotStatus));
    }
    
    public String toString() {
        
        StringBuffer buf = new StringBuffer();
        buf.append ("Process Step: ").append (m_processStepName).append (", Quantity: ").append (m_quantity).append ("\n");
        
        Iterator keys = m_lotNumberQtyAndDateOut.iterator();
        
        while (keys.hasNext()) {
            buf.append (keys.next()).append ("\n");
        }
        
        return buf.toString();
    }
}